|
|
|
|
|
|
|
When you have access keys defined for your menu items, the users can select a top-level menu item (in the menu bar) by holding down the Alt key and then pressing the access key. This action causes the submenu for that item to drop down, showing the items for that group. The users can then start the desired task by pressing the access key defined for the menu item. For example, for the New item of the File menu, users could press Alt+F and then press N. |
|
|
|
|
|
|
|
|
To create an effective set of access keys, you must specify a different key for each of the top-level menu items. Then you need to specify a different key for each of the items in the submenu. Conceivably, you can have up to 36 access keys on the same menu, one for each letter of the alphabet and one for each of the 10 digits, but you may run out of screen space for the choices before running out of letters. |
|
|
|
|
|
|
|
|
In addition to the access keys just discussed, you can assign shortcut keys to some of the more commonly used functions in your program. Shortcut keys provide direct access to a function through a single key (such as Delete) or key combination (such as Ctrl+S), bypassing the menu system entirely. Users can take advantage of shortcut keys to perform tasks quickly. |
|
|
|
|
|
|
|
|
To assign a shortcut key to one of your functions, enter the Menu Editor, select the menu item for which you want a shortcut key, and then select the desired key from the Shortcut list. The key is assigned to that function, and the shortcut key information appears next to the menu item in the menu. |
|
|
|
|
|
|
|
|
To illustrate this use, assign Ctrl+P as the shortcut key for the sample menu's File, Print function, as follows: |
|
|
|
|
|
|
|
|
1. Make sure Form1 is selected, and then open the Menu Editor. |
|
|
|
|
|
|
|
|
2. Click the Print menu item to select it. |
|
|
|
|
|
|
|
|
3. Click the drop-down arrow next to the Shortcut list, and select Ctrl+P from the list. |
|
|
|
|
|
|
|
|
4. On your own, assign the following shortcut keys: |
|
|
|
|
|
|
|
|
5. Click OK to close the Menu Editor. |
|
|
|
|
|
|
|
|
Now that you're back in the design environment, click the File menu to see how the shortcut key combinations are displayed. Figure 6.7 illustrates the results. |
|
|
|
|
|